import { proxybase } from '@/utils/constants'
import request from '@/utils/request'

export function roles(query) {
    return request({
        url: proxybase + 'user/roles',
        method: 'get',
        params: query
    })
}

export function users(query) {
    return request({
        url: proxybase + 'user/list',
        method: 'get',
        params: query
    })
}

export function createUser(data) {
    return request({
        url: proxybase + 'user/create',
        method: 'post',
        data
    })
}

export function updateUser(data) {
    return request({
        url: proxybase + 'user/modify',
        method: 'post',
        data
    })
}

export function changePass(data) {
    return request({
        url: proxybase + 'user/changePass',
        method: 'post',
        data
    })
}

export function resetPass(id) {
    return request({
        url: proxybase + 'user/resetPass',
        method: 'get',
        params: { id }
    })
}

export function removeUser(params) {
    return request({
        url: proxybase + 'user/remove',
        method: 'get',
        params
    })
}
